home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / winter_challenge.swf / scripts / frame_153 / PlaceObject2_262_111 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-08-19  |  1KB  |  39 lines

  1. onClipEvent(enterFrame){
  2.    if(alive == 1)
  3.    {
  4.       point = new object();
  5.       point.x = _root.bossClip.boss.bossInner._x;
  6.       point.y = _root.bossClip.boss.bossInner._y;
  7.       _root.bossClip.boss.bossInner.localToGlobal(point);
  8.       this._x = point.x;
  9.       this._y = point.y;
  10.       rot = Math.atan2(_root.ATVclip._y - this._y,_root.ATVclip._x - this._x);
  11.       rotNum = rot * 360 / 6.283185307179586;
  12.       this._rotation = rotNum;
  13.       i++;
  14.       if(i > 25 + random(100) && _root.gameInProgress == 1 && _root.bossClip.actionFlag == 1)
  15.       {
  16.          _root.ball._visible = 1;
  17.          duplicateMovieClip(_root.doppelBall,"newDoppelBall",16384 + (8000 + i));
  18.          var hyp = 35;
  19.          _root.newDoppelBall.pathRadius = 35;
  20.          _root.newDoppelBall.degrees = rotNum;
  21.          with(Math)
  22.          {
  23.             radians = _root.newDoppelBall.degrees * (PI / 180);
  24.             yCoor = hyp * Math.sin(radians);
  25.             xCoor = hyp * Math.cos(radians);
  26.          }
  27.          _root.newDoppelBall._x = this._x + xCoor;
  28.          _root.newDoppelBall._y = this._y + yCoor;
  29.          _root.newDoppelBall.targetX = _root.ATVclip._x;
  30.          _root.newDoppelBall.targetY = _root.ATVclip._y;
  31.          _root.newDoppelBall._rotation = this._rotation;
  32.          i = 1;
  33.          _root.CANNON_F.start(0,0);
  34.          this.play();
  35.          _root.doppelBall._visible = 0;
  36.       }
  37.    }
  38. }
  39.